#include "Utility.h"
#include <QtGui/QImageReader>
#include <QtCore/QList>
#include <QtCore/QByteArray>

QStringList Utility::getImageFileFilters(){
	static QStringList formats;
	if (formats.isEmpty()){
		QList<QByteArray> imgs=QImageReader::supportedImageFormats ();
		foreach(const QByteArray& bytes,imgs){
			QString format=QString("*.%1").arg(QString(bytes).trimmed());
			formats<<format;
		}
	}
	return formats;
}


int Utility::areaOfSize(const QSize& s){
	return s.width()*s.height();
}